﻿@{
    ViewBag.Title = "ViewPage1";
    Layout = "~/Views/Shared/BaseView.cshtml";
}
@{
    Common.Web.Cookie cookie = new Common.Web.Cookie();
    int visiterId = Convert.ToInt32(cookie.GetCookie("LoginUserId"));
    BenefitHelper.DB.DBManager db = new BenefitHelper.DB.DBManager();
    if (BenefitHelper.Sys.VisitPrower.HasAdminPrower(visiterId, db))
    { 
    <div id="buttons">
        <span>
            <p>
                <a href="/Init" target="_blank" title="后台管理">后台管理</a>
            </p>
        </span>
    </div>
    }
    db.Dispose();
}
<dl id="xiangmu">
    <dt><span id="title2" title="交易品种：<b>cu</b>">@ViewBag.op.UName</span></dt>
    <dd>
        <table width="100%" border="0" cellspacing="0" cellpadding="0" id="panhoufenxi">
            <tr>
                <td id="curr_p">
                    <b class="panzhong"><a href="/OperatorRealtimeTransaction/Index/@ViewBag.queryuser/@ViewBag.datequery">
                        盘中分析</a></b><b><a>盘后分析</a></b>
                </td>
                <td>
                    <a href="/AfterAnalysis/Index/@ViewBag.queryuser/@ViewBag.queryyear@ViewBag.querymonth">
                        <img src="/Content/images/icon_07.gif" />阶段总结</a>
                </td>
                <td class="selected">
                    <img src="/Content/images/icon_02.gif" />性能汇总
                </td>
                <td>
                    <a href="/StageSummary/Index/@ViewBag.queryuser/@ViewBag.queryyear@ViewBag.querymonth">
                        <img src="/Content/images/icon_03.gif" />历史成交</a>
                </td>
            </tr>
        </table>
    </dd>
</dl>
<div id="bigDataBox">
    <div class="date-select-bar">
        @for (int i = 1; i <= 12; i++)
        {
            if (!string.IsNullOrEmpty(ViewBag.querymonth.ToString()))
            {


                if (Convert.ToInt32(ViewBag.querymonth) == i)
                { 
            <a href="/XingNeng/Index/@ViewBag.queryuser/@ViewBag.queryyear@ViewBag.querymonth" class='cur'>@i</a>
                }
                else
                {
                    if (i < 10)
                    {
                        string z = "0" + i;
            <a href="/XingNeng/Index/@ViewBag.queryuser/@ViewBag.queryyear@z">@i</a>
                    }
                    else
                    {
            <a href="/XingNeng/Index/@ViewBag.queryuser/@ViewBag.queryyear@i">@i</a>
                    }

                }
            }
            else
            {
                if (i < 10)
                {
                    string z = "0" + i;
            <a href="/XingNeng/Index/@ViewBag.queryuser/@ViewBag.queryyear@z">@i</a>
                }
                else
                {
            <a href="/XingNeng/Index/@ViewBag.queryuser/@ViewBag.queryyear@i">@i</a>
                }

            }
        }
        @if (string.IsNullOrEmpty(ViewBag.querymonth.ToString()))
        {
            <a href="/XingNeng/Index/@ViewBag.queryuser/@ViewBag.queryyear" class='cur'>整年数据</a>
        }
        else
        {
            <a href="/XingNeng/Index/@ViewBag.queryuser/@ViewBag.queryyear">整年数据</a>
        }
    </div>
    <div class="date-select-bar" style="text-align: right; float: right;">
        @for (int i = 2011; i <= DateTime.Now.Year; i++)
        {
            if (Convert.ToInt32(ViewBag.queryyear) == i)
            {
            <a href="/AfterAnalysis/Index/@ViewBag.queryuser/@i@ViewBag.querymonth" class='cur'>@i</a>
            }
            else
            {
            <a href="/AfterAnalysis/Index/@ViewBag.queryuser/@i@ViewBag.querymonth">@i</a>
            }
        }
    </div>
    <br />
    <div style="height: 15px; line-height: 15px;">
    </div>
    <div style="width: 60%; background-repeat: no-repeat; float: left; text-align: left;">
        <img src="/content/images/shujufenxi.png" />
    </div>
    <table style="width: 100%; height: 300px;">
        <tr>
            <td style="width: 80%; vertical-align: top;">
                <div style="width: 100%; height: 190px;" id="showflash3">
                </div>
                <div style="width: 100%; height: 190px;" id="showflash4">
                </div>
            </td>
            <td style="width: 20%; vertical-align: top;">
                <div style="height: 30px; line-height: 30px;">
                </div>
                <table cellspacing="0" cellpadding="0" class="list" style="width: 100%;" id="timediv">
                    <tr>
                        <td class="title" style="text-align: left; padding-left: 10px;">
                        </td>
                        @if (!ViewBag.querymonth.Equals(""))
                        {
                            <td class="title" style="text-align: right;">
                                本月
                            </td>
                            <td class="title" style="text-align: left; padding-left: 10px;">
                                上月
                            </td>
                        }
                        else
                        {
                            <td class="title" style="text-align: right;">
                                今年
                            </td>
                            <td class="title" style="text-align: left; padding-left: 10px;">
                                去年
                            </td>
                        }
                        @if (!ViewBag.querymonth.Equals(""))
                        {
                            <td class="title" style="text-align: right;">
                                去年同期
                            </td>
                        }
                    </tr>
                    <tr>
                        <td style="text-align: left; padding-left: 10px;">
                            当月收益效率
                        </td>
                        <td style="text-align: right;">
                            @ViewBag.operatormonthsum.Yield
                        </td>
                        @if (!ViewBag.querymonth.Equals(""))
                        {
                            <td style="text-align: right;">
                                @ViewBag.yoperatormonthsum.Yield
                            </td>
                        }
                        <td style="text-align: right;" class="leftyes">
                            @ViewBag.quniantongqi.Yield
                        </td>
                    </tr>
                    <tr>
                        <td style="text-align: left; padding-left: 10px;">
                            平均持仓时间
                        </td>
                        <td style="text-align: right;">
                            @ViewBag.operatormonthsum.AvgPostionTime
                        </td>
                        @if (!ViewBag.querymonth.Equals(""))
                        {
                            <td style="text-align: right;">
                                @ViewBag.yoperatormonthsum.AvgPostionTime
                            </td>
                        }
                        <td style="text-align: right;" class="leftyes">
                            @ViewBag.quniantongqi.AvgPostionTime
                        </td>
                    </tr>
                    <tr>
                        <td style="text-align: left; padding-left: 10px;">
                            平均每笔盈利
                        </td>
                        <td style="text-align: right;">
                            @string.Format("{0:N2}", ViewBag.operatormonthsum.AvgBillBenefit)
                        </td>
                        @if (!ViewBag.querymonth.Equals(""))
                        {
                            <td style="text-align: right;">
                                @string.Format("{0:N2}", ViewBag.yoperatormonthsum.AvgBillBenefit)
                            </td>
                        }
                        <td style="text-align: right;" class="leftyes">
                            @string.Format("{0:N2}", ViewBag.quniantongqi.AvgBillBenefit)
                        </td>
                    </tr>
                    <tr>
                        <td style="text-align: left; padding-left: 10px;">
                            平均资金利用率
                        </td>
                        <td style="text-align: right;">
                            @ViewBag.operatormonthsum.Utilization %
                        </td>
                        @if (!ViewBag.querymonth.Equals(""))
                        {
                            <td style="text-align: right;">
                                @ViewBag.yoperatormonthsum.Utilization %
                            </td>
                        }
                        <td style="text-align: right;" class="leftyes">
                            @ViewBag.quniantongqi.Utilization %
                        </td>
                    </tr>
                    <tr>
                        <td style="text-align: left; padding-left: 10px;">
                            命中率
                        </td>
                        <td style="text-align: right;">
                            @if (ViewBag.operatormonthsum.WinCount + ViewBag.operatormonthsum.LoseCount != 0)
                            {
                                @(ViewBag.operatormonthsum.WinCount / (ViewBag.operatormonthsum.WinCount + ViewBag.operatormonthsum.LoseCount))
                            }
                            else
                            { 
                                @ViewBag.operatormonthsum.WinCount
                            }
                            %
                        </td>
                        @if (!ViewBag.querymonth.Equals(""))
                        {
                            <td style="text-align: right;">
                                @if (ViewBag.yoperatormonthsum.WinCount + ViewBag.yoperatormonthsum.LoseCount != 0)
                                {
                                    @(ViewBag.yoperatormonthsum.WinCount / ViewBag.yoperatormonthsum.WinCount + ViewBag.yoperatormonthsum.LoseCount)
                                }
                                else
                                { 
                                    @ViewBag.yoperatormonthsum.WinCount
                                }
                                %
                            </td>
                        }
                        <td style="text-align: right;" class="leftyes">
                            @if (ViewBag.quniantongqi.WinCount + ViewBag.quniantongqi.LoseCount != 0)
                            {
                                @(ViewBag.quniantongqi.WinCount / ViewBag.quniantongqi.WinCount + ViewBag.quniantongqi.LoseCount)
                            }
                            else
                            { 
                                @ViewBag.quniantongqi.WinCount
                            }
                            %
                        </td>
                    </tr>
                    <tr>
                        <td style="text-align: left; padding-left: 10px;">
                            超出止损次数
                        </td>
                        <td style="text-align: right;">
                            @ViewBag.operatormonthsum.OverStopLoss
                        </td>
                        @if (!ViewBag.querymonth.Equals(""))
                        {
                            <td style="text-align: right;">
                                @ViewBag.yoperatormonthsum.OverStopLoss
                            </td>
                        }
                        <td style="text-align: right;" class="leftyes">
                            @ViewBag.quniantongqi.OverStopLoss
                        </td>
                    </tr>
                    <tr>
                        <td style="text-align: left; padding-left: 10px;">
                            总盈利/总亏损
                        </td>
                        <td style="text-align: right;">
                            @if (ViewBag.operatormonthsum.LoseCount != 0)
                            {
                                @(ViewBag.operatormonthsum.WinCount / ViewBag.operatormonthsum.LoseCount)
                            }
                            else
                            { 
                                @ViewBag.operatormonthsum.WinCount
                            }
                        </td>
                        @if (!ViewBag.querymonth.Equals(""))
                        {
                            <td style="text-align: right;">
                                @if (ViewBag.yoperatormonthsum.LoseCount != 0)
                                {
                                    @(ViewBag.yoperatormonthsum.WinCount / ViewBag.yoperatormonthsum.LoseCount)
                                }
                                else
                                { 
                                    @ViewBag.yoperatormonthsum.WinCount
                                }
                            </td>
                        }
                        <td style="text-align: right;" class="leftyes">
                            @if (ViewBag.quniantongqi.LoseCount != 0)
                            {
                                @(ViewBag.quniantongqi.WinCount / ViewBag.quniantongqi.LoseCount)
                            }
                            else
                            { 
                                @ViewBag.quniantongqi.WinCount
                            }
                        </td>
                    </tr>
                    <tr>
                        <td style="text-align: left; padding-left: 10px;" class="bottomyes">
                            平进平出单
                        </td>
                        <td style="text-align: right;" class="bottomyes">
                            @ViewBag.operatormonthsum.PingJinPing
                        </td>
                        @if (!ViewBag.querymonth.Equals(""))
                        {
                            <td style="text-align: right;" class="bottomyes">
                                @ViewBag.yoperatormonthsum.PingJinPing
                            </td>
                        }
                        <td style="text-align: right;" class="leftyes bottomyes">
                            @ViewBag.quniantongqi.PingJinPing
                        </td>
                    </tr>
                </table>
            </td>
        </tr>
    </table>
    <div style="height: 5px; line-height: 5px;">
    </div>
    <table style="width: 100%; height: 300px;">
        <tr>
            <td style="width: 100%; vertical-align: top;">
                <div style="width: 100%; height: 260px;" id="showflash5">
                </div>
            </td>
        </tr>
    </table>
    <div style="height: 5px; line-height: 5px;">
    </div>
</div>
@MvcHtmlString.Create(ViewBag.js)
<script type="text/javascript">
    //BillCount();
    YearPie2();
    YearPie3();
    ShouYiBiLVLine();
</script>
